Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Runtime.InteropServices
Namespace C4F.DevKit.PictureAcquisition
    ''' <summary>
    ''' .Net wrapper over interfaces for picture acquisition.
    ''' </summary>
    Friend Class PictureAcquisitionNative
#Region "Interface imports"

        ''' <summary>
        ''' .Net wrapper over IPhotoAcquire interface.
        ''' </summary>
        <Guid("00f23353-e31b-4955-a8ad-ca5ebf31e2ce"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
        Friend Interface IPhotoAcquire
            <PreserveSig()> _
             Function CreatePhotoSource(ByVal pszDevice As String, ByRef photoAcquireSource As IPhotoAcquireSource) As Int32

            <PreserveSig()> _
             Function Acquire(ByVal pPhotoAcquireSource As IPhotoAcquireSource, ByVal fShowProgress As Int32, ByVal hWndParent As IntPtr, ByVal pszApplicationName As String, ByVal pPhotoAcquireProgressCB As IntPtr) As Int32

            <PreserveSig()> _
             Function EnumResults(ByRef ppEnumFilePaths As IEnumString) As Int32
        End Interface
        ''' <summary>
        ''' .Net wrapper over IEnumString interface.
        ''' </summary>
        <Guid("00000101-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
        Friend Interface IEnumString
            <PreserveSig()> _
             Function RemoteNext(<[In]()> _
                ByVal celt As UInteger, <MarshalAs(UnmanagedType.LPWStr)> _
                ByRef rgelt As String, ByRef pceltFetched As UInteger) As Int32

            <PreserveSig()> _
             Function Skip(<[In]()> _
              ByVal celt As UInteger) As Int32

            <PreserveSig()> _
             Function Reset() As Int32

            <PreserveSig()> _
             Function Clone(<MarshalAs(UnmanagedType.[Interface])> _
                ByRef ppenum As IEnumString) As Int32

        End Interface
        ''' <summary>
        ''' .Net wrapper over IPhotoAcquireDeviceSelectionDialog interface.
        ''' </summary>
        <Guid("00f28837-55dd-4f37-aaf5-6855a9640467"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
        Friend Interface IPhotoAcquireDeviceSelectionDialog
            <PreserveSig()> _
            Function SetTitle(<[In](), MarshalAs(UnmanagedType.LPWStr)> _
                ByVal pszTitle As String) As Int32

            <PreserveSig()> _
             Function SetSubmitButtonText(<[In](), MarshalAs(UnmanagedType.LPWStr)> _
                ByVal pszSubmitButtonText As String) As Int32

            <PreserveSig()> _
             Function DoModal(<[In]()> _
                 ByVal hWndParent As IntPtr, <[In]()> _
                 ByVal dwDeviceFlags As UInt32, <Out(), MarshalAs(UnmanagedType.BStr)> _
                 ByRef pbstrDeviceId As String, <Out()> _
                 ByRef pnDeviceType As UInt32) As Int32
        End Interface
        ''' <summary>
        ''' .Net wrapper over IPhotoAcquireItem interface.
        ''' </summary>
        <Guid("00f21c97-28bf-4c02-b842-5e4e90139a30"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
        Friend Interface IPhotoAcquireItem
            <PreserveSig()> _
             Function GetItemName(<MarshalAs(UnmanagedType.BStr)> _
                ByRef pbstrItemName As String) As Int32

            <PreserveSig()> _
             Function GetThumbnail(<[In]()> _
                 ByVal sizeThumbnail As IntPtr, <Out()> _
                 ByRef phbmpThumbnail As IntPtr) As Int32

            <PreserveSig()> _
            Function GetProperty(<[In]()> _
                ByVal key As IntPtr, <Out()> _
                ByRef pv As IntPtr) As Int32
            <PreserveSig()> _
             Function SetProperty(<[In]()> _
                ByVal key As IntPtr, <[In]()> _
                ByVal pv As IntPtr) As Int32

            <PreserveSig()> _
             Function GetStream(<Out()> _
                ByRef ppStream As System.Runtime.InteropServices.ComTypes.IStream) As Int32
            <PreserveSig()> _
             Function CanDelete(<Out()> _
                ByRef pfCanDelete As Boolean) As Int32

            <PreserveSig()> _
             Function Delete() As Int32

            <PreserveSig()> _
             Function GetSubItemCount(<Out()> _
                ByRef pnCount As UInt32) As Int32

            <PreserveSig()> _
             Function GetSubItemAt(<[In]()> _
                ByVal nItemIndex As UInt32, <Out()> _
                ByRef ppPhotoAcquireItem As IntPtr) As Int32
        End Interface
        ''' <summary>
        ''' .Net wrapper over IPhotoAcquireOptionsDialog interface.
        ''' </summary>
        <Guid("00f2b3ee-bf64-47ee-89f4-4dedd79643f2"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
        Friend Interface IPhotoAcquireOptionsDialog
            <PreserveSig()> _
             Function Initialize(<[In](), MarshalAs(UnmanagedType.LPWStr)> _
                ByVal pszRegistryRoot As String) As Int32

            <PreserveSig()> _
             Function Create(<[In]()> _
                ByVal hWndParent As IntPtr, <Out()> _
                ByRef phWndDialog As IntPtr) As Int32

            <PreserveSig()> _
             Function Destroy() As Int32

            <PreserveSig()> _
             Function DoModal(<[In]()> _
                ByVal hWndParent As IntPtr, <[In](), Out()> _
                ByRef ppnReturnCode As Int32) As Int32

            <PreserveSig()> _
            Function SaveData() As Int32
        End Interface
        ''' <summary>
        ''' .Net wrapper over IPhotoAcquireSettings interface.
        ''' </summary>
        <Guid("00f2b868-dd67-487c-9553-049240767e91"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
        Friend Interface IPhotoAcquireSettings
            <PreserveSig()> _
             Function InitializeFromRegistry(<[In](), MarshalAs(UnmanagedType.LPWStr)> _
                ByVal pszRegistryKey As StringBuilder) As Int32

            <PreserveSig()> _
             Function SetFlags(<[In]()> _
                ByVal dwPhotoAcquireFlags As UInt32) As Int32

            <PreserveSig()> _
             Function SetOutputFilenameTemplate(<[In](), MarshalAs(UnmanagedType.LPWStr)> _
                ByVal pszTemplate As String) As Int32

            <PreserveSig()> _
             Function SetSequencePaddingWidth(<[In]()> _
                ByVal dwWidth As UInt32) As Int32

            <PreserveSig()> _
             Function SetSequenceZeroPadding(<[In]()> _
                ByVal fZeroPad As Int32) As Int32

            <PreserveSig()> _
             Function SetGroupTag(<[In](), MarshalAs(UnmanagedType.LPWStr)> _
                ByVal pszGroupTag As StringBuilder) As Int32

            <PreserveSig()> _
             Function SetAcquisitionTime(<[In]()> _
                ByVal pftAcquisitionTime As System.Runtime.InteropServices.ComTypes.FILETIME) As Int32

            <PreserveSig()> _
             Function GetFlags(<Out()> _
                ByRef pdwPhotoAcquireFlags As UInt32) As Int32

            <PreserveSig()> _
             Function GetOutputFilenameTemplate(<Out(), MarshalAs(UnmanagedType.BStr)> _
                ByRef pbstrTemplate As String) As Int32

            <PreserveSig()> _
             Function GetSequencePaddingWidth(<Out()> _
                ByRef pdwWidth As UInt32) As Int32

            <PreserveSig()> _
             Function GetSequenceZeroPadding(<Out()> _
                ByRef pfZeroPad As Boolean) As Int32

            <PreserveSig()> _
             Function GetGroupTag(<Out(), MarshalAs(UnmanagedType.BStr)> _
                ByRef pbstrGroupTag As String) As Int32

            <PreserveSig()> _
             Function GetAcquisitionTime(<Out()> _
                ByRef pftAcquisitionTime As System.Runtime.InteropServices.ComTypes.FILETIME) As Int32

        End Interface
        ''' <summary>
        ''' .Net wrapper over IPhotoAcquireSource interface.
        ''' </summary>
        <Guid("00f2c703-8613-4282-a53b-6ec59c5883ac"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
        Friend Interface IPhotoAcquireSource
            <PreserveSig()> _
             Function GetFriendlyName(<Out(), MarshalAs(UnmanagedType.BStr)> _
                ByRef pbstrFriendlyName As String) As Int32

            <PreserveSig()> _
             Function GetDeviceIcons(<[In]()> _
                ByVal nSize As UInt32, <[In](), Out()> _
                ByRef phLargeIcon As IntPtr, <[In](), Out()> _
                ByRef phSmallIcon As IntPtr) As Int32

            <PreserveSig()> _
             Function InitializeItemList(<[In]()> _
                ByVal fForceEnumeration As Boolean, <[In]()> _
                ByVal pPhotoAcquireProgressCB As IntPtr, <Out()> _
                ByRef pnItemCount As UInt32) As Int32

            <PreserveSig()> _
             Function GetItemCount(<Out()> _
                ByRef pnItemCount As UInt32) As Int32

            <PreserveSig()> _
             Function GetItemAt(<[In]()> _
                ByVal nIndex As UInt32, <Out()> _
                ByRef ppPhotoAcquireItem As IPhotoAcquireItem) As Int32

            <PreserveSig()> _
             Function GetPhotoAcquireSettings(<Out()> _
                ByRef ppPhotoAcquireSettings As IPhotoAcquireSettings) As Int32

            <PreserveSig()> _
             Function GetDeviceId(<Out(), MarshalAs(UnmanagedType.BStr)> _
                ByRef pbstrDeviceId As StringBuilder) As Int32

            <PreserveSig()> _
             Function BindToObject(<[In]()> _
                ByVal riid As Guid, <Out()> _
                ByRef ppv As IntPtr) As Int32

        End Interface
#End Region

#Region "Class imports"
        ''' <summary>
        ''' .Net wrapper over PhotoAcquire class.
        ''' </summary>
        <ComImport(), Guid("00f26e02-e9f2-4a9f-9fdd-5a962fb26a98")> _
        Friend Class PhotoAcquire
        End Class
        ''' <summary>
        ''' .Net wrapper over PhotoAcquireDeviceSelectionDialog class.
        ''' </summary>
        <ComImport(), Guid("00f29a34-b8a1-482c-bcf8-3ac7b0fe8f62")> _
        Friend Class PhotoAcquireDeviceSelectionDialog
        End Class
        ''' <summary>
        ''' .Net wrapper over PhotoAcquireOptionsDialog class.
        ''' </summary>
        <ComImport(), Guid("00f210a1-62f0-438b-9f7e-9618d72a1831")> _
        Friend Class PhotoAcquireOptionsDialog
        End Class
#End Region

    End Class
End Namespace
